#include"Comm.hpp"
int main()
{
    Fifo fifo(Path);
    int rfd = open(Path,O_RDONLY);
    if(rfd<0){
        cout<<"open file fail"<<endl;
        return 1;
    }

    cout<<"open file success"<<endl;
    char buffer[1024] {0};
    while(true)
    {
        int n = read(rfd,buffer,sizeof(buffer));
        if(n < 0){
            cout<<"read file fail"<<endl;
            break;
        }else if(n==0){
            cout<<"client close"<<endl;
            break;
        }else {
            cout<<"client say:"<<buffer<<endl;
        }
        
    }

    close(rfd);
    return 0;
}